<form class="form-horizontal" role="form" method="post">
  {% csrf_token %}
  <div class="form-group">
    <label for="name" class="col-sm-2 control-label">{{ form.fields.name.label }}</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="name" name="name" placeholder="{{ form.fields.name.help_text }}" value="{{ contactkeeper.contact.name }}">
      {% if form.name.errors %}
        {% for error in form.name.errors %}
          <p class="alert-danger" >{{ error }}</p>
        {% endfor %}
      {% endif %}
    </div>
  </div>
  <div class="form-group">
    <label for="phone" class="col-sm-2 control-label">{{ form.fields.phone.label }}</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="phone" name="phone" placeholder="{{ form.fields.phone.help_text }}" value="{{ contactkeeper.contact.phone }}">
      {% if form.phone.errors %}
        {% for error in form.phone.errors %}
          <p class="alert-danger" >{{ error }}</p>
        {% endfor %}
      {% endif %}
    </div>
  </div>
  <div class="form-group">
    <label for="email" class="col-sm-2 control-label">{{ form.fields.email.label }}</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="email" name="email" placeholder="{{ form.fields.email.help_text }}" value="{{ contactkeeper.contact.email }}">
      {% if form.email.errors %}
        {% for error in form.email.errors %}
          <p class="alert-danger" >{{ error }}</p>
        {% endfor %}
      {% endif %}
    </div>
  </div>

  <div class="form-group">
    <label for="address" class="col-sm-2 control-label">地区</label>
    <div class="col-xs-3">
      <select class="form-control" id="province" name="province">
        <option value="contactkeeper.contact.province">{{ contactkeeper.contact.province }}</option>
       </select>
    </div>
    <div class="col-xs-3">
      <select class="form-control" id="city" name="city">
        <option value="{{ contactkeeper.contact.city }}">{{ contactkeeper.contact.city }}</option>
       </select>
    </div>
    <div class="col-xs-4">
      <select class="form-control" id="district" name="district">
        <option value="{{ contactkeeper.contact.district }}">{{ contactkeeper.contact.district }}</option>
       </select>
    </div>
  </div>

  <div class="form-group">
    <label for="street" class="col-sm-2 control-label">{{ form.fields.street.label }}</label>
    <div class="col-sm-10">
      <textarea class="form-control" id="street" name="street" placeholder="{{ form.fields.street.help_text }}">{{ contactkeeper.contact.street }}</textarea>
      {% if form.street.errors %}
        {% for error in form.street.errors %}
          <p class="alert-danger" >{{ error }}</p>
        {% endfor %}
      {% endif %}
    </div>
  </div>
  <div class="form-group">
    <label for="name" class="col-sm-2 control-label">{{ form.fields.postcode.label }}</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="name" name="postcode" placeholder="{{ form.fields.postcode.help_text }}" value="{{ contactkeeper.contact.postcode }}">
      {% if form.postcode.errors %}
        {% for error in form.postcode.errors %}
          <p class="alert-danger" >{{ error }}</p>
        {% endfor %}
      {% endif %}
    </div>
  </div>

  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <button type="submit" class="btn btn-default">提交</button>
    </div>
  </div>
</form>
